#! /bin/sh

OPER_GNB_IF=enp5s0
OPER_AMF_IP=192.168.200.60/24
OPER_UPF_IP=192.168.12.158/24

ip netns delete gnb_ns
ip link del veth0

#在与运营商基站对接的网口上配置运营商AMF IP
ip netns add gnb_ns
ip link set $OPER_GNB_IF netns gnb_ns
ip netns exec gnb_ns ifconfig $OPER_GNB_IF $OPER_AMF_IP up
ip netns exec gnb_ns ifconfig $OPER_GNB_IF:n3 $OPER_UPF_IP up

ip link add veth0 type veth peer name veth1
ip link set veth1 netns gnb_ns
ip addr add 190.160.10.2/24 dev veth0
ip netns exec gnb_ns ip addr add 190.160.10.3/24 dev veth1
ip link set dev veth0 up
ip netns exec gnb_ns ip link set dev veth1 up
